<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script>
</head>
<body>
    <div>
        <a href="{:U('listAll')}">全部</a>
        <a href="{:U('listICreated')}">我创建的</a>
        <a href="{:U('listIRespon')}">我负责的</a>
        <a href="{:U('listIRelated')}">与我相关</a>
    </div>
    <span style="display: none">{$type}</span>
    <ul><volist name="list" id="item" key="key" >
        <li class="item" data-id="{$item.id}">
            <pre>{:json_encode($item,JSON_UNESCAPED_UNICODE|JSON_PRETTY_PRINT)}</pre>
            <p>创建日期:{:date("Y-m-d",$item["create_time"])}</p>
        </li>
    </volist></ul>
    <div>
        <button onclick="create()">新建</button>
        <button onclick="modify()">修改</button>
    </div>
    <style>
        .selected{
            background-color:darkseagreen;
        }
    </style>
    <script>
        $(".item").click(function(){
            var obj=$(this);
            obj.siblings().removeClass("selected");
            obj.addClass("selected");
            // $(this).data("id");
        });
        function create(){
            location.href='{:U("create")}';
        }
        function modify(){
            var id=$(".selected").eq(0).data("id");
            var url="{:U('modify',['id'=>'4w9f6vc9d02r3k3e'])}";
            url=url.replace("4w9f6vc9d02r3k3e",id);
            location.href=url;
        }
    </script>
</body>
</html>